Skip to content

The modern mode, "use strict" #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Oct 19, 2019

Conversation

sjsakib
Copy link
Contributor

@sjsakib sjsakib commented Oct 17, 2019

No description provided.

Copy link
Member

@jaamaalxyz jaamaalxyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have mentioned some minor changes. fixed these comments and commit again. thanks


That had the benefit of never breaking existing code. But the downside was that any mistake or an imperfect decision made by JavaScript's creators got stuck in the language forever.
এর একটি সুবিধা ছিল যে, কখনোই পুরনো কোড নস্ট হত না, মানে পুরনো কোডও নতুন জাভাস্ক্রিপ্ট ভার্সনে চলত। তবে অসুবিধা হল জাভাস্ক্রিপ্টের উদ্ভাবকদের করা কোন ভুল বা ত্রুটিপূর্ণ সিদ্ধান্ত চিরতরে ভাষটাটিতে থেকে যেত।
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ভাষটাটিতে => ভাষাটিতে


This was the case until 2009 when ECMAScript 5 (ES5) appeared. It added new features to the language and modified some of the existing ones. To keep the old code working, most such modifications are off by default. You need to explicitly enable them with a special directive: `"use strict"`.
২০০৯ সালে ECMAScript 5 (ES5) আসার আগ পর্যন্ত এভাবেই চলছিল। ES5 ভাষাটিতে নতুন কিছু ফিচার যোগ করার পাশাপাশি পুরনো কিছু ফিচারও পরিবর্তন করে করে। পুরনো কোড সচল রাখতে এই পরিবর্তনগুলোর বেশিরভাগই ডিফল্টভাবে বন্ধ রাখা হয়। একটি বিশেষ নির্দেশক `"use strict"` ব্যবহার করে এগুলো আলাদাভাবে সক্রিয় করতে হয়।
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

২০০৯ সালে ECMAScript 5 (ES5) আসার আগ পর্যন্ত এভাবেই চলছিল। ES5 ভাষাটিতে নতুন কিছু ফিচার যোগ করার পাশাপাশি পুরনো কিছু ফিচারও পরিবর্তন করে করে।

এখানে করে শব্দটি একবার ব্যবহার হবে।

...
```

We will learn functions (a way to group commands) soon. Looking ahead, let's note that `"use strict"` can be put at the beginning of the function body instead of the whole script. Doing that enables strict mode in that function only. But usually, people use it for the whole script.
শিঘ্রই আমরা ফাংশন (কামান্ড গ্রুপ করার একটি উপায়) শিখব। একটু এগিয়ে গিয়ে নোট করে নেয়া যাক, `"use strict"` কোন ফাংশনের বডির শুরুতেও দেয়া যায়। এতে করে শুধু ঐ ফাংশনে স্ট্রিক্ট মোড সক্রিয় হয়। তবে সাধারণত পুরো স্ক্রিপ্টের জন্যই স্ট্রিক্ট মোড ব্যবহার করা হয়।
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

কামান্ড should be কমান্ড


Once we enter strict mode, there's no return.
একবার স্ট্রিক্ট মোডে ঢুকে গেলে আর কোন ফিরে যাওয়া নেই।
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

একবার স্ট্রিক্ট মোডে ঢুকে গেলে আর কোন ফিরে যাওয়া নেই।

এই ব্যাকটি - একবার স্ট্রিক্ট মোডে ঢুকে গেলে আর ফিরে যাওয়ার কোন সুযোগ থাকে না।

2. Strict mode is enabled by placing `"use strict"` at the top of a script or function. Several language features, like "classes" and "modules", enable strict mode automatically.
3. Strict mode is supported by all modern browsers.
4. We recommended always starting scripts with `"use strict"`. All examples in this tutorial assume strict mode unless (very rarely) specified otherwise.
১. `"use strict"` নির্দেশকটি বিল্ট-ইন ফিচারগুলোর চরিত্র বদলে ইন্জিনকে "আধুনিক" মোডে নিয়ে যায়। পরব্তী আমরা এর বিস্তারিত দেখব।
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

পরব্তী should be পরবর্তীতে

@javascript-translate-bot

Please make the requested changes. After it, add a comment "/done".
Then I'll ask for a new review 👻

@sjsakib
Copy link
Contributor Author

sjsakib commented Oct 19, 2019

সরি ভাই, রিভাইজ না করেই দিয়ে দিসিলাম

@sjsakib
Copy link
Contributor Author

sjsakib commented Oct 19, 2019

/done

Copy link
Contributor

@raikusy raikusy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ছোট কিছু চেঞ্জ আছে... ঠিক হলে এপ্রুভ হয়ে যাবে।


For a long time, JavaScript evolved without compatibility issues. New features were added to the language while old functionality didn't change.
অনেক লম্বা সমায় ধরে কোন কম্প্যাটিবিলিট ইস্যু ছাড়াই জাভাস্ক্রিপ্টের পর্যায়ক্রমিক উন্নতি হয়েছে। ভষাটিতে নতুন নতুন ফিচার যোগ করা হত, পুরনো ফাংশনালিটি বদলাত না।
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
অনেক লম্বা সমায় ধরে কোন কম্প্যাটিবিলিট ইস্যু ছাড়াই জাভাস্ক্রিপ্টের পর্যায়ক্রমিক উন্নতি হয়েছে। ভষাটিতে নতুন নতুন ফিচার যোগ করা হত, পুরনো ফাংশনালিটি বদলাত না
অনেক লম্বা সময় ধরে কোন কম্প্যাটিবিলিটি ইস্যু ছাড়াই জাভাস্ক্রিপ্টের পর্যায়ক্রমিক উন্নতি হয়েছে। ভাষাটিতে নতুন নতুন ফিচার যোগ করা হয়েছে, তবে পুরনো ফাংশনালিটি পরিবর্তন হয়নি

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

অর্থ বদলে যায়। এখনে আগের কথা বলা হয়েছে। টাইপোগুলা ঠিক করতেসি।

@javascript-translate-bot

Please make the requested changes. After it, add a comment "/done".
Then I'll ask for a new review 👻

@sjsakib
Copy link
Contributor Author

sjsakib commented Oct 19, 2019

/done

Copy link
Contributor

@raikusy raikusy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ঠিক আছে। মার্জ করা যায়। @jamal-pb95 ভাইয়ের রিভিউ এর অপক্ষায় রইলো।

Copy link
Member

@jaamaalxyz jaamaalxyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything is ok. ready to be merge. Cheers @sjsakib vai. 💯 👍 😄 🐯

@jaamaalxyz jaamaalxyz merged commit 46b1e52 into javascript-tutorial:master Oct 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants